import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home.vue'
import Reg from "../components/login/reg.vue"
import Login from "../components/login/login.vue"
import Cart from "../components/cart/Cart.vue"
import Search from "../components/search/Search.vue"
import Hot from "../components/hot/Hot.vue"
import User from "../components/user/user.vue"
import Cartarticle from "../components/cart/Cartarticle.vue"
import Searchresult from "../components/search/Searchresult.vue"
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/reg',
      component: Reg
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/cart',
      component: Cart
    },
    {
      path: '/search',
      component: Search
    },
    {
      path: '/hot',
      component: Hot
    },
    {
      path: '/user',
      component: User
    },
    {
      path: '/cart/article/:id',
      component:Cartarticle
    },
    {
      path: '/search/result/:name',
      component:Searchresult,
    }

  ],
  linkActiveClass:'active'  //覆盖默认的路由高亮的类

})
